#include "pwm.h"
#include "sample.h"
#include "heater.h"
#include "ui.h"

#ifndef MAIN_H
#define MAIN_H

//Regular defines
#define NULL	0x00
#define NOP __asm__ __volatile__ ("nop")	//Single cycle nop.
#define NOP2 __asm__ __volatile__("jmp $+0x02") 	//single cycle nop.
#define NOP5 __asm__ __volatile__("mov @R4,0(R4)") 	//single cycle nop.

#define EVENT_TIMER	0x0200	/*64 hz events*/

#define LEDS_OUT	(BIT0 | BIT1 | BIT2 | BIT3 | BIT4 | BIT5)
#define AUX_OUT		(BIT2 | BIT3 | BIT5)

struct BuzzKeeper
{
	struct Inputs
	{
		unsigned int select_accum;
		unsigned int enter_accum;
		unsigned int both_accum;
	} inputs;
	void (*ButtonBoth)();
	void (*ButtonSelect)();
	void (*ButtonEnter)();
	struct Options
	{
		int heater_adjust;
		unsigned int time_interval;
		unsigned int sample_delay;
	} options;
} buzzkeeper;

enum Drink { None = 0, Liquor = 1, Beer = 2, Water = 3};
enum Status { Ready = 1, Wait = 2, Heating = 3, Config = 4};

void (*event_handler)();

#endif
